In an existing data network, a burst of packet traffic often leads to network congestion. To avoid such network congestion and improve the Quality of Traffic (QoS) of the data network, the packet traffic needs to be limited at a receiver. If the rate of a packet is lower than a specified rate, the packet is received normally. If the rate of the packet exceeds the specified rate, the packet is discarded or marked.
With a method widely adopted at present, the packet traffic is limited by a leaky bucket, and common leaky-bucket-based standards include RFC(Request for Comments) 2697 and RFC2698, i.e. single-rate three-color dual buckets and two-rate three-color dual buckets. FIG. 1 shows the principle of traffic limitation by a leaky bucket in an RFC standard, which specifically includes that: tokens are filled into a leaky bucket continuously according to a specified rate until the leaky bucket is overrrun. When a packet arrives, the length of the packet is compared with the number of tokens in the leaky bucket. If there are enough tokens in the leaky bucket, the packet is allowed to pass. and a number of tokens corresponding to the length of the packet is taken away from the leaky bucket. If there are not enough tokens in the leaky bucket, the packet is discarded or marked.
It can be seen that although the packet traffic can be limited using RFC2697 and RFC2698, QoSs for packets with different priorities cannot be distinguished during the traffic-limitation, leading to low flexibility in an existing method for limiting the packet traffic, which is disadvantageous for improving QoS and user experience of a data network.